package caronas.util;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.ResourceBundle;

import com.sun.org.apache.xerces.internal.impl.xpath.regex.ParseException;

import br.com.caelum.vraptor.Convert;
import br.com.caelum.vraptor.Converter;

@Convert(Date.class)  
public class DateConverter implements Converter<Date> {
	
	 public Date convert(String value,Class<? extends Date> type, ResourceBundle bundle) {  
         Date result = new Date();
		 try{
			 result = new SimpleDateFormat("dd/MM/yyyy HH:mm").parse(value);  
		 }
		 catch(java.text.ParseException e){
			 
		 }
		 
		 return result;
         
    }  
}
